package com.yonyou.crm.sys.menu.ctrl;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.yonyou.crm.common.rest.util.ResponseUtil;
import com.yonyou.crm.sys.menu.entity.MenuModuleVO;
import com.yonyou.crm.sys.menu.rmitf.IMenuModuleRmService;

@RestController
@Scope("prototype")
@RequestMapping("/sys/menuitem")
public class MenuCtrl {

	@Autowired
	private IMenuModuleRmService service;
	
	@RequestMapping(method=RequestMethod.GET)
	public Object getMenuList(HttpServletRequest request, HttpServletResponse response){
		JSONObject result = new JSONObject();
		List<MenuModuleVO> menuList = service.getModuleList();
		result.put("data", menuList);
		return ResponseUtil.getObject(result);
	}
	
}
